export const normFile = (e: any) => {
  if (Array.isArray(e)) {
    return e;
  }
  return e && e.fileList;
};

export function fangdou<T>(
  fn: (this: T, ...args: any[]) => void,
  display: number
) {
  let timer: any;
  return function (this: T, ...args: any[]) {
    if (timer) {
      clearTimeout(timer);
    }
    timer = setTimeout(() => {
      fn.apply(this, args);
    }, display);
  };
}
